package jp.sourceforge.akjrcp.draw2d;

import jp.sourceforge.akjrcp.akj_betas.Messages;
import jp.sourceforge.akjrcp.dropsomething.DropsomethingView;

import org.eclipse.ui.PlatformUI;



public class OpenPerspectiveButton extends RoundRectangleButton {
	private String perspectiveID;
	public String getPerspectiveID() {
		return perspectiveID;
	}
	public void setPerspectiveID(String perspectiveID) {
		this.perspectiveID = perspectiveID;
	}
	protected void clickButton(){
		//close intro
		PlatformUI.getWorkbench().getIntroManager().closeIntro(PlatformUI.getWorkbench().getIntroManager().getIntro());
		
		PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(
				PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(perspectiveID)
				);
		//PlatformUI.getWorkbench().getActiveWorkbenchWindow().openPage(perspectiveID,null)	;
		DropsomethingView ds=(DropsomethingView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(DropsomethingView.ID);
		ds.selectSomething(Messages.getString("greycstoration.tab_title"));

	}
}
